package cn.edu.ujn.ch10.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.ch10.dao.Customer;
import cn.edu.ujn.ch10.dao.CustomerMapper;
@Service
public class CustomerServiceImpl implements ICustomerService {
@Autowired
	private CustomerMapper customerMapper;
	
	@Override
	public Customer addCustomer(Customer customer) {
		
		int insert = customerMapper.insert(customer);
		
		return customer;
	}

	@Override
	public Customer findById(int id) {
	    
		
		
		return customerMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Customer> findAll() {
		
		return customerMapper.findAll();
	}

}
